package com.yeyks.common.utils.apputil.enums;

/**
 * 酒店星级
 * @author Administrator
 */
public enum StarLevelEnum {
    /**
     * 酒店星级集合
     */
    HOME_STAY("2","民宿"),
    THREE_STAR("3","三星级"),
    FOUR_STAR("4","四星级"),
    FIVE_STAR("5","五星级"),
    BUSINESS("6","商务"),
    ;

    /**
     * code
     */
    private String code;

    /**
     * msg
     */
    private String msg;

    StarLevelEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 根据 code值获取msg
     * @param code code值
     * @return
     */
    public static String getMsgByCode(String code){
        for(StarLevelEnum bedTypeEnum: StarLevelEnum.values()){
            if(code.equals(bedTypeEnum.getCode())){
                return bedTypeEnum.getMsg();
            }
        }
        return  null;
    }
}
